#include <QApplication>
#include <QDialog>
#include <QPushButton>
#include <QRadioButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLineEdit>
#include <QTextEdit>


int main(int c, char **v)
{
  QApplication app(c, v);
  QDialog d(NULL);
  QVBoxLayout *bigvlay = new QVBoxLayout();
  QHBoxLayout *firsthlay = new QHBoxLayout();
  QGridLayout *firstgridlay = new QGridLayout();
  QHBoxLayout *secondhlay = new QHBoxLayout();
  QVBoxLayout *secondvlay = new QVBoxLayout();
  QHBoxLayout *thirdhlay = new QHBoxLayout();
  QHBoxLayout *fourthhlay = new QHBoxLayout();

  QLabel *label1 = new QLabel("The Ultimate Form.\nPlease provide the following data:", &d);
  label1->setAlignment(Qt::AlignCenter);
  bigvlay->addWidget(label1);
  QLabel *label2 = new QLabel("General:", &d);
  label2->setAlignment(Qt::AlignTop);
  firsthlay->addWidget(label2);
  firsthlay->addItem(new QSpacerItem(30, 20));
  firstgridlay->addWidget(new QLabel("Name:"), 1, 1);
  firstgridlay->addWidget(new QLineEdit(&d), 1, 2);
  firstgridlay->addWidget(new QLabel("Surname:"), 2, 1);
  firstgridlay->addWidget(new QLineEdit(&d), 2, 2);
  firsthlay->addItem(firstgridlay);
  secondhlay->addWidget(new QLabel("Personal:"));
  secondhlay->addItem(new QSpacerItem(30, 20));
  secondhlay->addWidget(new QLabel("Gender:", &d));
  secondhlay->addItem(new QSpacerItem(10, 20));
  secondvlay->addWidget(new QRadioButton("Male", &d));
  secondvlay->addWidget(new QRadioButton("Female", &d));
  secondhlay->addItem(secondvlay);
  secondhlay->addStretch(QSizePolicy::Maximum);
  QLabel *label3 = new QLabel("Comments:", &d);
  label3->setAlignment(Qt::AlignTop);
  thirdhlay->addWidget(label3);
  thirdhlay->addItem(new QSpacerItem(20, 20));
  thirdhlay->addWidget(new QTextEdit(&d));
  fourthhlay->addWidget(new QPushButton("Submit", &d));
  fourthhlay->addWidget(new QPushButton("Save", &d));
  fourthhlay->addWidget(new QPushButton("Clear", &d));
  bigvlay->addItem(firsthlay);
  bigvlay->addItem(secondhlay);
  bigvlay->addItem(thirdhlay);
  bigvlay->addItem(new QSpacerItem(200, 20));
  bigvlay->addItem(fourthhlay);


  d.setLayout(bigvlay);
  d.show();

  return app.exec();
}
